Report post

What is delay in jQuery?

As far as I understand, .delay () is meant specifically for adding a delay between methods in a given jQuery queue. For example, if you wanted to fade an image into view during the span of 1 second, have it visible for 5 seconds, and then spend another second to fade it out of view again, you could do the following:

Can I cancel a delay in jQuery?

Just keep in mind you can't cancel a delay, if for some reason you want to advance your animation, but you can with setTimeout. As far as I understand, .delay () is meant specifically for adding a delay between methods in a given jQuery queue.

Why should I use wait instead of delay in jQuery?

The reason why you should use .wait instead of .delay is because not all jquery functions are supported by .delay and that .delay only works with animation functions. For example delay does not support .addClass and .removeClass Or you can use this function instead.

The World's Leading Crypto Trading Platform

Get my welcome gifts